<?php

use yii\helpers\Html;
use kartik\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\business\models\BusinessContractCategorySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '合同分类';
$this->params['breadcrumbs'][] = $this->title;
?>


<section class="wrapper site-min-height">
    <!-- page start-->
    <section class="panel">
        <header class="panel-heading">
              <?= Html::a('返回','javascript:history.back(-1)'); ?>  <?= Html::encode($this->title) ?>
        </header>
        <div class="panel-body">
            <div class="adv-table editable-table ">
 


<div class="business-contract-category-index">

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('新建合同分类', ['create'], ['class' => 'btn btn-success']) ?>
    </p>


    <?php
        echo GridView::widget([
            'dataProvider'=>$dataProvider,
            'filterModel'=>$searchModel,
            'showPageSummary'=>true,
            'pjax'=>false,
            'striped'=>true,
            'hover'=>true,
            'panel'=>['type'=>'primary', 'heading'=>'合同分类管理'],
            'containerOptions'=>['style'=>'overflow: auto'], // only set when $responsive = false
            'headerRowOptions'=>['class'=>'kartik-sheet-style'],
            'filterRowOptions'=>['class'=>'kartik-sheet-style'],
            'columns'=>[
                [
                    'attribute'=>'id',
                    'pageSummaryOptions'=>['class'=>'text-right text-warning'],
                    'width'=>'100px',
                ],
                [
                    'attribute'=>'title',
                    'pageSummaryOptions'=>['class'=>'text-right text-warning'],
                    'width'=>'100px',
                ],
                [
                    'class' => '\kartik\grid\ActionColumn',
                    'template' => '{view} {update} {delete} {addcontract}',
                    'buttons' => [
                        'addcontract' => function ($url, $model) {
                            return Html::a('<span class="glyphicon glyphicon-plus"></span>','/business/contract/create?cateid='.$model->id,[
                                'title' => '添加合同','class'=>'pdetail','data-id'=>$model->id,
                            ]);
                        }
                    ],
                ],
                [
                    'class' => '\kartik\grid\CheckboxColumn'
                ]
            ],
            'toolbar'=> [
                '{export}',
                '{toggleData}',
            ],
            'bordered'=>true,
            'condensed'=>true,
        ]);
    ?>
</div>
</div>
</div>
</section>
</section>





